package com.yvan.demo.mvc;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import java.util.List;

@Configuration
public class JztdMvcAutoConfigration extends WebMvcConfigurerAdapter {
    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        // 拦截 http请求，转换为想要的数据
        // org.springframework.web.method.support.InvocableHandlerMethod:156 行
        argumentResolvers.add(new QueryParamResolver());
        argumentResolvers.add(new JsonBodyResolver());
        argumentResolvers.add(new PageDbResolver());
        argumentResolvers.add(new JsonWapperResolver());
        argumentResolvers.add(new ParameterParserResolver());
    }
}
